/**
 * jQuery的自定义工具插件
 */
(function($){
	
	$.fn.me_setData = function(options){
		var setting = $.extend({
			data : null,
			selector : "td"
		},options||{});
		if(!setting.data){
			alert("必须传入数据");
			return;
		}
		var target = this;
		var tbData = setting.data;
		target.find(setting.selector).empty().each(function(index){
			var opts = $(this).attr("data-opts");
			var s = '{'+opts+'}';
			opts = (new Function('return '+s))();
			var text = tbData[opts.field];
			$(this).html(text);
		}); 
		return this;
	};
})(jQuery)